<?php
defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>

 <script type="text/javascript">
        function ktradatoida(datoithieu,datoida)
        {
            if(datoida.selectedIndex < datoithieu.selectedIndex)
			{
                alert("Đáp án tối thiểu phải nhỏ hơn đáp án tối đa");
				datoida.selectedIndex = datoithieu.selectedIndex;
			}
        }
		 function ktradatoithieu(datoithieu,datoida)
        {
            if(datoida.selectedIndex < datoithieu.selectedIndex)
			{             
				datoida.selectedIndex = datoithieu.selectedIndex;
			}
        }
		
        function delete_text(noidung,luachon) 
        {
            noidung.value="";
            for(x in luachon)
                {
                    x.value="";
                }
        }
 </script>
<div class="registration<?php echo $this->pageclass_sfx?>">
<jdoc:include type="message"/> <!---message---->
<?php $listchude = $this->chude; ?>
<h1 ><font color="#000000">Tạo Câu Hỏi</font> </h1>
<br/>
<br/>
<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_cauhoi&task=cauhoi.luu'); ?>" method="post" class="form-validate">
 <fieldset class="adminform">
     <legend><h2><font color="#000000">Thông Tin</font></h2></legend>
    <table width="600" cellspacing="5" cellpadding="5">
      <tr>
        <td width="200" style="padding-left:30px ; background-color:#E2E4E0" >Chủ đề</td>
        <td width="200" ><label  for="chude"></label>
          <select name="chude" id="chude" style="width:400px;" >
              
              <?php
              foreach ($listchude as $row)
              {?>
              <option value=" <?php echo $row->machudecon; ?>"> <?php echo $row->tenchudecon; ?></option>
                 <?php 
              }
              ?>
        </select></td>
      </tr>
      <tr>
        <td width="200" style="padding-left:30px; background-color:#E2E4E0" >Nội dung câu hỏi</td>
        <td width="75"><label for="noidung3"></label>
            <textarea name="noidung" cols="60" id="noidung" value ="them" style="height:30px"></textarea></td>
      </tr>
    </table>
  </fieldset>
    
    <!----lua chon-->
  <fieldset>
      <legend><h2><font color="#000000">Lựa chọn</font> </h2></legend>
      <table width="600" cellspacing="5" cellpadding="5">
                          
        <tr>
          <td style="padding-left:30px; background-color:#E2E4E0" >Lựa chọn 1</td>
          <td >
              <input name="luachon[]" type="text" id="luachon1" size="75" style="height:30px" /></td>
        </tr>
        <tr>
        <td style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 2</td>
        <td ><input name="luachon[]" type="text" id="luachon2" size="75" style="height:30px" /></td>
        </tr>
        <tr>
        <td  style="padding-left:30px ; background-color:#E2E4E0">Lựa chọn 3</td>
        <td ><input name="luachon[]" type="text" id="luachon3" size="75" style="height:30px" /></td>
        </tr>
        <tr>
        <td style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 4</td>
        <td ><input name="luachon[]" type="text" id="luachon4" size="75" style="height:30px" /></td>
        </tr>
         <tr>
        <td  style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 5</td>
        <td ><input name="luachon[]" type="text" id="luachon5" size="75" style="height:30px" /></td>
        </tr>
         <tr>
        <td  style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 6</td>
        <td ><input name="luachon[]" type="text" id="luachon6" size="75" style="height:30px" /></td>
        </tr>
         <tr>
        <td   style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 7</td>
        <td  ><input name="luachon[]" type="text" id="luachon7" size="75" style="height:30px" /></td>
        </tr>
         <tr>
        <td   style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 8</td>
        <td  ><input name="luachon[]" type="text" id="luachon8" size="75" style="height:30px" /></td>
        </tr>
         <tr>
        <td  style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 9</td>
        <td  ><input name="luachon[]" type="text" id="luachon9" size="75"  style="height:30px"/></td>
        </tr>
         <tr>
        <td  style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 10</td>
        <td  ><input name="luachon[]" type="text" id="luachon10" size="75"  style="height:30px"/></td>
        </tr>
         <tr>
        <td  style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 11</td>
        <td ><input name="luachon[]" type="text" id="luachon11" size="75"  style="height:30px"  /></td>
        </tr>
         <tr>
        <td  style="padding-left:30px; background-color:#E2E4E0">Lựa chọn 12</td>
        <td  ><input name="luachon[]" type="text" id="luachon12" size="75" style="height:30px" /></td>
        </tr>
      </table>
    </fieldset>
    
      <fieldset>
          <legend><h2><font color="#000000">Qui định</font> </h2></legend>
    <table width="600" border="0" cellspacing="5" cellpadding="5">
        <tr>
             <td width="300" style="padding-left:30px ; background-color:#E2E4E0" ><label>Số đáp án tối thiểu được chọn</label></td>
        <td><label  for="sodapan"></label>
          <select name="datoithieu" id="datoithieu" style="width:100px;" onchange="ktradatoithieu(datoithieu,datoida)" >
              
              <?php
              for($i=0;$i<=12;$i++)
              {?>
              <option value=" <?php echo $i; ?>"> <?php echo $i; ?></option>
                 <?php 
              }
              ?>
        </select></td>
        </tr> 
        <tr>
             <td width="300" style="padding-left:30px ; background-color:#E2E4E0" ><label>Số đáp án tối đa được chọn</label></td>
        <td><label  for="sodapan"></label>
          <select name="datoida" id="datoida" style="width:100px;" onchange="ktradatoida(datoithieu,datoida)" selected>
              
              <?php
              for($i=0;$i<=12;$i++)
              {?>
              <option value=" <?php echo $i; ?>"> <?php echo $i; ?></option>
                 <?php 
              }
              ?>
        </select></td>
        </tr>      
    </table>
      </fielset>
    <table width="600" border="0" cellspacing="5" cellpadding="5">
        <tr> 
        <td align="right"><input type="submit" name="task" id="luu"  value="Lưu"  style=" padding-bottom: 5px; padding-top: 5px; padding-left:50px; padding-right:50px; border-radius: 10px 10px 10px 10px;background-color:#EE3341; color:#000;padding-left:30px; padding-right:30px;" /></td>
        <td style="padding-left: 30px"><input type="submit" name="task2" id="huy"  value="Hủy" onclick="delete_text(noidung,luachon)" style="padding-bottom: 5px; padding-top: 5px; padding-left:50px; padding-right:50px; border-radius: 10px 10px 10px 10px;background-color:#EE3341; color:#000;padding-left:30px; padding-right:30px;" /></td>
        </tr>
       
    </table>
  <div>
			<input type="hidden" name="option" value="com_cauhoi" />
			<input type="hidden" name="task" value="cauhoi.luu" />
			<?php echo JHtml::_('form.token');?>
		</div>
        </form>
</div>

